package com.example.demowebview;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

@SuppressLint("SetJavaScriptEnabled")
public class MainActivity extends Activity {
	private String url = "http://news.zing.vn/";
	private WebView webview;
	private WebSettings websetting;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		Bundle bundle = getIntent().getExtras();
		url = bundle.getString(ListBookActivity.LINK, url);
		webview = (WebView) findViewById(R.id.webview);
		websetting = webview.getSettings();
		websetting.setSupportZoom(true);
		websetting.setTextZoom(100);
		websetting.setDisplayZoomControls(false);
		websetting.setJavaScriptCanOpenWindowsAutomatically(true);
		websetting.setJavaScriptEnabled(true);
		webview.setWebViewClient(new WebViewClient());
		webview.setWebChromeClient(new WebChromeClient());
		webview.loadUrl(url);
	}
}
